//
//  EnterWindow.cpp
//  CardGame
//
//  Created by wangdi on 13-8-23.
//
//

#include "EnterWindow.h"
#include "../../Scene/MainScene.h"
using namespace cocos2d;
using namespace storm;

void EnterWindow::onEnter()
{
    UIPanel::onEnter();
    
    CCSprite *pSprBk = CCSprite::create(CSTR(ResPathLogin + "login_bg01.jpg"));
    pSprBk->setPosition(ccpAdjustRes(768/2, 1136/2));
    addChild(pSprBk);

    UIButton *pBtn = UIButton::Create(CSTR(ResPathLogin + "login_bt01.png"));
    pBtn->SetScaleFactor(1.1f);
    pBtn->setPosition(ccpAdjustRes(768/2, 200));
	pBtn->OnClick.connect(this, &EnterWindow::OnEnterMainScene);
	AddChildWidget(pBtn);

	CCSprite *pSprTitle = CCSprite::create(CSTR(ResPathLogin + "login_nm01.png"));
	pSprTitle->setPosition(ccpAdjustRes(768/2, 750));
	addChild(pSprTitle);
    
}

void EnterWindow::OnEnterMainScene(storm::UIButton *pSender)
{
	MainScene::Show();
}
